<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>收益支付</title>
    <script src="../jQuery/jquery-1.11.2.js"></script>
    <link rel="stylesheet" href="../layui/css/layui.css"/>
    <script src="../layui/layui.js"></script>
    <link rel="stylesheet" type="text/css" href="/css/font.css">
</head>
<body>
<blockquote class="layui-elem-quote news_search">
    <!--多条件查询层-->
    <div style="float: left;display: none">
        <form class="layui-form layui-col-md12 x-so">
            <!--查询日期：-->
            <div class="layui-input-inline">
                <input type="date" name="date" id="date" placeholder="请输入统计日期" autocomplete="off" class="layui-input"/>
            </div>
            <button id="search" class="layui-btn  layui-btn-primary layui-bg-gray" lay-submit data-type="reload" lay-filter="provinceSearch">
                <i class="layui-icon">&#xe615;</i>
            </button>
        </form>
    </div>
    <!--多条件查询结束-->

    <!--头部工具栏-->
    <div class="layui-btn-container layui-input-inline" style="margin-left: 1000px;">
        <button class="layui-btn layui-btn-normal" id="btn" lay-event="getCheckData" style="width: 100px;">统计</button>
    </div>
    <script type="text/html" id="secStock_search">

    </script>

    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">现金计息计入</li>
            <li>债券计息计入</li>
            <li>两费付出</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <table class="layui-hide" id="test" lay-filter="test"></table>
                <script>
                    layui.use(['table','layer'],function () {
                        var table = layui.table;
                        var layer=layui.layer;
                        var tables=table.render({
                            elem: '#test'
                            , url: '../EarningAlipayController/cashAlipay/method'
                            ,height:"520px"
                            , toolbar: '#secStock_search' //开启头部工具栏，并为其绑定左侧模板
                            , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                                title: '提示'
                                , layEvent: 'LAYTABLE_TIPS'
                                , icon: 'layui-icon-tips'
                            }]
                            , title: '用户数据表'
                            , cols: [[ //表头
                                {field: 'accName', title: '账户名称', sort: true, fixed: 'left'}
                                , {field: 'businType', title: '业务类型'}
                                , {field: 'businTime', title: '业务日期', sort: true,templet:function (d) {
                                        return layui.util.toDateString(d.businTime,'yyyy-MM-dd');
                                    }}
                                , {field: 'dofa', title: '资金方向',templet:function(d){
                                    if (d.dofa==-1){
                                        return "流出";
                                    }else{
                                        return "流入";
                                    }
                                    }}
                                , {field: 'expMoney', title: '收支金额(元)',templet:function (d) {
                                        if (d.expMoney.toString().indexOf(".")!=-1){
                                            return d.expMoney.toLocaleString();
                                        }else{
                                            return (d.expMoney+ '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g,'$1,')+".00";
                                        }
                                    }}
                            ]]
                            , page: true
                            ,limits:[5,10,15,20]
                        });

                        //点击统计按钮
                        $("#btn").click(function () {
                            $.ajax({
                                url:"../EarningAlipayController/total",
                                type:"get",
                                data:"",
                                success:function (data) {
                                    if (data=="success"){
                                        //location.reload();
                                        table.reload("test");
                                        table.reload("test1");
                                        table.reload("test2");
                                        layer.msg("统计成功",{icon:1});
                                    }
                                    else if (data=="fail") layer.msg("统计失败",{icon:2});
                                    else if (data=="already") layer.msg("当天已统计",{icon:5});
                                    else layer.msg(data);
                                }
                            });
                        });

                    });
                </script>
            </div>
            <div class="layui-tab-item">
                <table class="layui-hide" id="test1" lay-filter="test1"></table>
                <script>
                    layui.use('table', function () {
                        var table = layui.table;

                        table.render({
                            elem: '#test1'
                            , url: '../EarningAlipayController/bondAlipay/method'
                            ,height:740
                            , toolbar: '#secStock_search' //开启头部工具栏，并为其绑定左侧模板
                            , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                                title: '提示'
                                , layEvent: 'LAYTABLE_TIPS'
                                , icon: 'layui-icon-tips'
                            }]
                            , title: '用户数据表'
                            ,limit:15
                            , cols: [[ //表头
                                {field: 'bondName', title: '债券名称', sort: true, fixed: 'left'}
                                , {field: 'businType', title: '业务类型',templet:function(d){
                                        if (d.businType==1){
                                            return "非银行间";
                                        }else{
                                            return "银行间";
                                        }
                                    }}
                                , {field: 'businDate', title: '业务日期',templet:function (d) {
                                        return layui.util.toDateString(d.businDate,'yyyy-MM-dd');
                                    }}
                                , {field: 'dofa', title: '资金方向',templet:function(d){
                                    if (d.dofa==-1){
                                        return "流出";
                                    }else{
                                        return "流入";
                                    }
                                    }}
                                , {field: 'expMoney', title: '收支金额(元)', sort: true,templet:function (d) {
                                        if (d.expMoney.toString().indexOf(".")!=-1){
                                            return d.expMoney.toLocaleString();
                                        }else{
                                            return (d.expMoney+ '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g,'$1,')+".00";
                                        }
                                    }}
                            ]]
                            , page: true
                            ,limits: [5, 10,20,30,50]
                            ,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
                                return {
                                    "code": res.code, //解析接口状态
                                    "msg": res.msg, //解析提示文本
                                    "count": res.count, //解析数据长度
                                    "data": res.data //解析数据列表
                                }}
                        });
                    });
                </script>
            </div>
            <div class="layui-tab-item">
                <table class="layui-hide" id="test2" lay-filter="test2"></table>
                <script>
                    layui.use('table', function () {
                        var table = layui.table;

                        table.render({
                            elem: '#test2'
                            , url: '../EarningAlipayController/twoAlipay/method'
                            ,height:"520px"
                            , toolbar: '#secStock_search' //开启头部工具栏，并为其绑定左侧模板
                            , page: true
                            ,limits:[10,20]
                            , defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                                title: '提示'
                                , layEvent: 'LAYTABLE_TIPS'
                                , icon: 'layui-icon-tips'
                            }]
                            , title: '用户数据表'
                            , cols: [[ //表头
                                {field: 'accName', title: '账户名称', sort: true, fixed: 'left'}
                                , {field: 'businType', title: '业务类型'}
                                , {field: 'businTime', title: '业务日期', sort: true,templet:function (d) {
                                        return layui.util.toDateString(d.businTime,'yyyy-MM-dd');
                                    }}
                                , {field: 'dofa', title: '资金方向',templet:function(d){
                                    if (d.dofa==-1){
                                        return "流出";
                                    }else{
                                        return "流入";
                                    }
                                    }}
                                , {field: 'expMoney', title: '收支金额(元)',templet:function (d) {
                                        if (d.expMoney.toString().indexOf(".")!=-1){
                                            return d.expMoney.toLocaleString();
                                        }else{
                                            return (d.expMoney+ '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g,'$1,')+".00";
                                        }
                                    }}
                            ]]
                            ,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
                                return {
                                    "code": res.code, //解析接口状态
                                    "msg": res.msg, //解析提示文本
                                    "count": res.count, //解析数据长度
                                    "data": res.data //解析数据列表
                                }}

                        });
                    });
                </script>
            </div>
        </div>
    </div>

    <script>
        //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function () {
            var element = layui.element;

            //…
        });
    </script>
</blockquote>
</body>
</html>